package com.water_work_form.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.water_work_form.entity.BasicPh;
import com.water_work_form.mapper.BasicPhMapper;
import com.water_work_form.service.BasicPhService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 基础表——滴定pH——滴定质控 服务实现类
 * </p>
 *
 * @author xuke
 * @since 2023-08-01
 */
@Service
public class BasicPhServiceImpl extends ServiceImpl<BasicPhMapper, BasicPh> implements BasicPhService {

    @Autowired
    BasicPhMapper basicPhMapper;

    /**
     * 滴定pH——滴定质控 查看（分页）
     * @param name 溶液名称
     * @param current 分页 当前页
     * @param size 分页 每页数据量
     * @return 返回当页数据
     */
    @Override
    public IPage<BasicPh> listPh(String name, Integer current, Integer size){
        QueryWrapper<BasicPh> queryWrapper = new QueryWrapper<>();
        if(name != null && name.length() > 0){
            queryWrapper.like("name", name);
        }
        IPage<BasicPh> page = new Page<>(current, size);
        return this.page(page, queryWrapper);
    }

}
